@layout("/backend/common/_container.html"){
<div class="dhcc-form">
    <form method='post' id="importForm" name="importForm" action="${backendPath}/sds/sdsstanddatasource/import" enctype="multipart/form-data">
        <#Hidden id="parentId" value="${parentId}"/>
        <div class="form-group">
            <div class="ele">
                <input class="hisui-filebox" name="file" data-options="width:415,buttonText:'选择文件',prompt:'excel文件：*.xls,*.xlsx'" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/>
            </div>
        </div>
    </form>
    <div class="alert alert-danger" role="alert">
        <strong>注意：</strong>
        <p>未测试</p>
    </div>

    <div class="toolbar">
        <#Button name="导入" id="ensure" icon="icon-w-import" clickFun="MgrData.importUsers()"/>
        <#Button btnCss="l-bt-red" name="关闭" id="cancel" icon="icon-w-close" clickFun="MgrData.close()"/>
    </div>
</div>

<script>
    var MgrData={};
    MgrData.importUsers = function () {
        var options = {
            success: function(res) {
                Sys.success("导入成功！");
                MgrData.close();
            },
            error: function(res) {
                Sys.error(res.responseJSON.error+":"+res.responseJSON.message);
            }
        };

        $('#importForm').ajaxSubmit(options);
    };
    /**
     * 关闭此对话框
     */
    MgrData.close = function () {
        parent.layer.close(parent.layer.getFrameIndex(window.name)); //先得到当前iframe层的索引,再执行关闭
    };
</script>

@}
